package com.haixiaoke.saas.repository.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotNull;
import java.util.Date;


/**
 * 电子签合同信息对象 biz_electronic_signing_contract
 *
 * @author qixi
 * @date 2023-12-26
 */
public class ElectronicSigningContract extends House {
    private static final long serialVersionUID = 1L;

    /**
     * 合同签署状态：0未生成 1待签署 2租客签约 3签署完成 4已终止 5已逾期
     */
    public static final long CONTRACT_STATE_NOT = 0L; // 未生成
    public static final long CONTRACT_STATE_AWAIT_SIGN = 1L; // 待签署
    public static final long CONTRACT_STATE_TENANT_SIGN = 2L; // 租客签约
    public static final long CONTRACT_STATE_SIGN_OK = 3L;
    public static final long CONTRACT_STATE_STOP = 4L;

    public static final long CONTRACT_STATE_OVERDUE = 5L;

    private Long contractId;

    /**
     * 房屋id
     */
    @NotNull(message = "房屋id不能为空")
    private String houseId;

    /**
     * 签署人id
     */
    private String userId;

    /**
     * 签署人姓名
     */
    private String userName;

    /**
     * 签署人手机号
     */
    @NotNull(message = "签署人手机号不能为空")
    private String userPhone;

    /**
     * 经办人id
     */
    private String agentId;

    /**
     * 签署模板id
     */
    private String templateId;

    /**
     * 合同流程id
     */
    private String flowId;

    /**
     * 发起机构id
     */
    private Long orgId;

    /**
     * 发起机构名称
     */
    private String orgName;

    /**
     * 合同签署状态：0未生成 1待签署 2租客签约 3签署完成 4已终止 5已逾期
     */
    private Long contractState;

    /**
     * 合同发起时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date contractCreateTime;

    /**
     * 合同签署完成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date contractCompletionTime;

    /**
     * 合同开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date contractStartTime;

    /**
     * 合同结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date contractEndTime;

    public void setContractId(Long contractId) {
        this.contractId = contractId;
    }

    public Long getContractId() {
        return contractId;
    }

    public void setHouseId(String houseId) {
        this.houseId = houseId;
    }

    public String getHouseId() {
        return houseId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setAgentId(String agentId) {
        this.agentId = agentId;
    }

    public String getAgentId() {
        return agentId;
    }

    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }

    public String getTemplateId() {
        return templateId;
    }

    public void setFlowId(String flowId) {
        this.flowId = flowId;
    }

    public String getFlowId() {
        return flowId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setContractState(Long contractState) {
        this.contractState = contractState;
    }

    public Long getContractState() {
        return contractState;
    }

    public void setContractCreateTime(Date contractCreateTime) {
        this.contractCreateTime = contractCreateTime;
    }

    public Date getContractCreateTime() {
        return contractCreateTime;
    }

    public void setContractCompletionTime(Date contractCompletionTime) {
        this.contractCompletionTime = contractCompletionTime;
    }

    public Date getContractCompletionTime() {
        return contractCompletionTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("contractId", getContractId())
                .append("houseId", getHouseId())
                .append("userId", getUserId())
                .append("userName", getUserName())
                .append("userPhone", getUserPhone())
                .append("agentId", getAgentId())
                .append("templateId", getTemplateId())
                .append("flowId", getFlowId())
                .append("orgId", getOrgId())
                .append("orgName", getOrgName())
                .append("contractState", getContractState())
                .append("contractCreateTime", getContractCreateTime())
                .append("contractCompletionTime", getContractCompletionTime())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }

    public Date getContractEndTime() {
        return contractEndTime;
    }

    public void setContractEndTime(Date contractEndTime) {
        this.contractEndTime = contractEndTime;
    }

    public Date getContractStartTime() {
        return contractStartTime;
    }

    public void setContractStartTime(Date contractStartTime) {
        this.contractStartTime = contractStartTime;
    }
}
